package org.vison.wonfu.framework.soa.discovery;

import org.vison.wonfu.framework.soa.annotation.LoadBalance;

import java.util.List;

public interface ServiceRegistryDiscovery {

    /**
     * 服务注册
     * @param service
     */
    void register(ServiceInstance service);

    /**
     * 服务注销
     * @param service
     */
    void deregister(ServiceInstance service);

    /**
     * 获取服务实例列表
     * @param serviceId
     * @return
     */
    List<ServiceInstance> discover(String serviceId);

    ServiceInstance loadbalanceSelect(List<ServiceInstance> instances, LoadBalance loadBalance);

    /**
     * 获取所有服务列表
     * @return
     */
    List<String> getServices();
}
